class DefaultChannelsController < ApplicationController
  def index
    @default_channels = DefaultChannel.all
  end

  def show
    @default_channel = DefaultChannel.find(params[:id])
  end

  def new
    @default_channel = DefaultChannel.new
  end

  def create
    @default_channel = DefaultChannel.new(params[:default_channel])
    if @default_channel.save
      redirect_to @default_channel, :notice => "Successfully created default channel."
    else
      render :action => 'new'
    end
  end

  def edit
    @default_channel = DefaultChannel.find(params[:id])
  end

  def update
    @default_channel = DefaultChannel.find(params[:id])
    if @default_channel.update_attributes(params[:default_channel])
      redirect_to @default_channel, :notice  => "Successfully updated default channel."
    else
      render :action => 'edit'
    end
  end

  def destroy
    @default_channel = DefaultChannel.find(params[:id])
    @default_channel.destroy
    redirect_to default_channels_url, :notice => "Successfully destroyed default channel."
  end
end
